package com.wangchao.excletransform.code.controller;


import com.wangchao.excletransform.code.service.ExcleTransformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/")
public class ExcleTransformController {

    @Autowired
    private ExcleTransformService excleTransformService;

    @GetMapping("/index")
    public ModelAndView toIndexPage(){
        return new ModelAndView("index");
    }


    @PostMapping("/upload")
    public Map<String, String> uploadFile(HttpServletRequest request){
        return excleTransformService.uploadFile(request);
    }
}
